import {onegoods} from "../../utils/api"
export const state={
    list:[],
}

export const mutations={
    changeonegoods(state,arr){
        state.list=arr
    },
   
}

export const actions={
    reqChangeOnegoods(context,obj){
        onegoods(obj).then(res=>{
            let arr=res.data.list.goodData
            context.commit("changeonegoods",arr)
        })
    },
    clearonegoods(context){
        context.commit("changeonegoods",[])
    }
}

export const getters={
    list(state){
    return state.list
    },
  
}

export default {
    state,
    actions,
    mutations,
    getters,
    namespaced:true,
}